Current Location: Home> Function Categories> fmod

fmod

Returns the remainder of the floating point number of division
Name:fmod
Category:math
Programming Language:php
One-line Description:Returns the remainder of the floating point number for division.

Definition and usage

fmod() function returns the floating point remainder of the division.

Example

In this example, we will use the fmod() function to return the remainder of 5/2:

 <?php
$r = fmod ( 5 , 2 ) ;
echo $r
?>

Try it yourself

grammar

 fmod ( x , y )
parameter describe
x Required. A number.
y Required. A number.

illustrate

Returns the floating point remainder obtained by dividing the dividend ( x ) by the divisor ( y ). The remainder (r) is defined as: x = i * y + r, where i is an integer. If y is a non-zero value, the signs of r and x are the same and their number values ​​are less than y .

Similar Functions
  • Calculate the oblique length of a straight triangle hypot

    hypot

    Calculatetheobliquel
  • Hyperbolic sine sinh

    sinh

    Hyperbolicsine
  • Returns exp(number) - 1, and can calculate the exact result even when the value of number is close to zero. expm1

    expm1

    Returnsexp(number)-1
  • Find the maximum value max

    max

    Findthemaximumvalue
  • Sine sin

    sin

    Sine
  • Returns the remainder of the floating point number of division fmod

    fmod

    Returnstheremaindero
  • Arctangle of two parameters atan2

    atan2

    Arctangleoftwoparame
  • Perform floating point division under IEEE 754 semantics fdiv

    fdiv

    Performfloatingpoint